#pragma once
enum GrappleState { IDLE, EXTENDING, RETRACTING, ATTACHED };
enum GrappleDirection { Up, Down, Left, Right };

#include "..//SGD Wrappers/SGD_Math.h"
#include "Tool.h"

class GrappleObject;
class GameObject;
class Player;

class GrapplingArm : public Tool
{
private:
	GrappleState		currState;	
	tVector2D			prevPosition;	
	bool				hasAttached;	
	GameObject*			objectAttached;	
	bool				isDisabled;	
	GrappleObject*		grapplebody;
	GrappleDirection	direction;
	mutable RECT		drawbox, hitbox;
	int					ImageLR, ImageUD;
	float				sizeoffset;
	float				DifferenceX, DifferenceY;
	float				playerpreviousposX, playerpreviousposY;

public:
	GrapplingArm(void);
	~GrapplingArm(void);

	void Update( float deltaTime );
	void Render( void ) const;
	void Disable( void );
	void Enable( void );
	void ActivateTool( Arm* arm );
	void DeactivateTool( void );
	void CollideNoAttach( void );
	void SideCollide( void );

	void SetAttached( GameObject* object );
	void SetDifX( float Dif ) { DifferenceX = Dif; }
	void SetDifY( float Dif ) { DifferenceY = Dif; }

	GrappleDirection GetDirection( void ) { return direction; }
	float GetDifX( void ) { return DifferenceX; }
	float GetDifY( void ) { return DifferenceY; }
	bool GetAttached( void ) { return hasAttached; }
	GameObject* GetGrappleObj( void ) {return (GameObject*)grapplebody;};
};

